Telegram Group & Telegram Channel
🕕 Задача по Java: Что будет выведено?


public class Main {
public static void main(String[] args) {
Integer a = 127;
Integer b = 127;
Integer c = 128;
Integer d = 128;

System.out.println(a == b); // ?
System.out.println(c == d); // ?
}
}


Варианты:
A) true, true
B) true, false
C) false, true
D) false, false

Правильный ответ: B

Объяснение:
Java кэширует объекты Integer в диапазоне -128 ... 127.
a == b — то же значение и тот же объект.
c == d — разные объекты вне кэша. Используй .equals() для сравнения!



tg-me.com/java_quizes/217
Create:
Last Update:

🕕 Задача по Java: Что будет выведено?


public class Main {
public static void main(String[] args) {
Integer a = 127;
Integer b = 127;
Integer c = 128;
Integer d = 128;

System.out.println(a == b); // ?
System.out.println(c == d); // ?
}
}


Варианты:
A) true, true
B) true, false
C) false, true
D) false, false

Правильный ответ: B

Объяснение:
Java кэширует объекты Integer в диапазоне -128 ... 127.
a == b — то же значение и тот же объект.
c == d — разные объекты вне кэша. Используй .equals() для сравнения!

BY Java tests


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_quizes/217

View MORE
Open in Telegram


Java tests Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

The seemingly negative pandemic effects and resource/product shortages are encouraging and allowing organizations to innovate and change.The news of cash-rich organizations getting ready for the post-Covid growth economy is a sign of more than capital spending plans. Cash provides a cushion for risk-taking and a tool for growth.

Java tests from in


Telegram Java tests
FROM USA